def E(t):
    for b in range (2, int(t**0.5)+1):
        if t%b==0:
            break
        else:
            print("простое")
            break
p2p=['zero' , 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']
a=input().split()
if len(a)!=3:
    print("Wrong input")
else:
    for i in range(3):
        if a[i] not in p2p:
            print("Wrong input")
            break
for i in range(10):
    if a[0]==p2p[i]:
        x=i*100
    if a[1]==p2p[i]:
        y=i*10
    if a[2
         ]==p2p[i]:
        z=i*1
s=x+y+z
E(s)
print(s)
        
